package com.jay.media.kit

import java.text.SimpleDateFormat
import java.util.*

/**
 * Create by xuzhou4
 * Date 2021/11/15
 */
object DateUtils {

    fun getFormatDate(): String {
        return SimpleDateFormat("MM月dd日，E").format(Date())
    }

    fun formatMin(time: Long): String {
        val sec = (time / 1000).toInt()
        val m = sec / 60
        val s = sec % 60

        val stringBuilder = StringBuilder()
        if (m.toString().length < 2) {
            stringBuilder.append("0")
        }
        stringBuilder.append(m)

        stringBuilder.append(":")

        if (s.toString().length < 2) {
            stringBuilder.append("0")
        }
        stringBuilder.append(s)

        return stringBuilder.toString()
    }
}